/*
 * @Descripttion: 调用接口公共方法
 * @version: 1.0.0
 * @Author: zhanganwu
 * @Date: 2020-02-24 13:33:28
 * @LastEditors: zhanganwu
 * @LastEditTime: 2020-02-25 12:14:26
 */

const API = {
    // 本人的常用卡号查询
    querySelfContacts: 'directBank.querySelfContacts',
    // 非本人常用联系人查询
    queryTopContactsNoSelf: 'directBank.queryTopContactsNoSelf',
    // 转入联系人查询
    queryTransinContact: 'directBank.queryTransinContact',
    // 根据收款账号查询开户行信息
    getCardBin: 'directBank.getCardBin',
    // 查询卡账户信息
    queryCardInfos: 'directBank.queryCardInfos',
    // 转账额度限制查询
    queryTransferLimit: 'directBank.queryTransferLimit',
    // 转账路由查询
    selectRouter: 'directBank.selectRouter',
    //转账权限查询
    transferNewJudge: 'directBank.transferNewJudge',
    //查询预留手机号
    getTelephoneNumber: 'directBank.getTelephoneNumber',
    //获取短信验证码
    sendSMSCode: 'directBank.sendSMSCode',
    //密码防重接口
    prepare: 'dbank.prepare',
    //校验短信验证码
    verifySMSCode: 'directBank.verifySMSCode',
    //周期付新增支出接口
    signPlan: 'directBank.signPlan',
    //根据收款卡号匹配查询常用联系人（是否需要验证码）接口
    isNeedSmsCode: 'directBank.isNeedSmsCode',
    //转账提交
    transfer: 'directBank.transfer',
    //云盾加签申请
    applySign: 'directBank.applySign',
    //云盾服务下载
    safeguard: 'directBank.safeguard'
};

//  ===============================================================

/**
 * 本人的常用卡号查询
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const querySelfContacts = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.querySelfContacts, params, 0, '', token, options);
};

/**
 * 非本人常用联系人查询
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const queryTopContactsNoSelf = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.queryTopContactsNoSelf, params, 0, '', token, options);
};

/**
 * 转入联系人查询
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const queryTransinContact = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.queryTransinContact, params, 0, '', token, options);
};

/**
 * 根据收款账号查询开户行信息
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const getCardBin = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.getCardBin, params, 0, '', token, options);
};

/**
 * 查询卡账户信息
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const queryCardInfos = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.queryCardInfos, params, 4, '', token, options);
};

/**
 * 转账额度限制查询接口
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const queryTransferLimit = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.queryTransferLimit, params, 4, '', token, options);
};

/**
 * 转账路由查询接口
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const selectRouter = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.selectRouter, params, 4, '', token, options);
};

/**
 * 转账权限查询
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const transferNewJudge = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.transferNewJudge, params, 4, '', token, options);
};

/**
 * 查询预留手机号
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const getTelephoneNumber = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.getTelephoneNumber, params, 4, '', token, options);
};

/**
 * 获取短信验证码
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const sendSMSCode = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.sendSMSCode, params, 2, '', token, options);
};

/**
 * 密码防重接口
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const prepare = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.prepare, params, 0, '', token, options);
};

/**
 * 校验短信验证码
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const verifySMSCode = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.verifySMSCode, params, 0, '', token, options);
};

/**
 * 周期付新增支出接口
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const signPlan = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.signPlan, params, 4, '', token, options);
};

/**
 * 根据收款卡号匹配查询常用联系人（是否需要验证码）接口
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const isNeedSmsCode = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.isNeedSmsCode, params, 4, '', token, options);
};

/**
 * 根据收款卡号匹配查询常用联系人（是否需要验证码）接口
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const transfer = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.transfer, params, 4, '', token, options);
};

/**
 * 云盾加签申请
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const applySign = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.applySign, params, 4, '', token, options);
};

/**
 * 云盾服务下载
 * @param {Object} params 上送参数
 * @returns {Promise}
 */
export const safeguard = (params = {}, token = '', options = {}) => {
    return app.api.rpc(API.safeguard, params, 4, '', token, options);
};
